﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSetting.aspx.cs"
    Inherits="Thksoft.ParameterSettings.ProjectSetting" %>

<%@ Register Src="../UserCotrols/ProjectTreeView.ascx" TagName="Basic_TreeView" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="L_UI" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>项目设置</title>
    <link href="../CSS/Main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .cont_list td {
            cursor: pointer;
        }

        .tdleft {
            text-align: left;
            padding-left: 10px;
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        function ToReport(dataid, key, nameText) {
            document.getElementById("hidProID").value = dataid;
            document.getElementById("hidKey").value = key;
            document.getElementById("<%=this.btnQuery.ClientID %>").click();
        }
        function showmodal() {
            //debugger;
            top.MessageBox.OpenCode({ Window: window, Type: 2, TextID: 'FORM_CODE_STRING', ValueID: 'FORM_CODE_IDS', PROID: <%=PROID %> });
        }
    </script>
    <form id="form1" runat="server">
        <!--隐藏的表单信息 -->
        <asp:HiddenField ID="hidProID" Value="" runat="server" />
        <asp:HiddenField ID="hidKey" Value="" runat="server" />
        <asp:HiddenField ID="hidFatherId" Value="" runat="server" />
        <asp:HiddenField ID="hidProidUp" Value="" runat="server" />
        <div class="main_show" style="height: 100%">
            <table id="tb_3" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 800px;">
                <tr style="width: 100%;" style="height: 100%">
                    <td style="border: 2px solid #6aa4d2; margin-top: 10px; min-height: 100%; overflow: hidden; vertical-align: top">
                        <uc1:Basic_TreeView ID="Basic_TreeView1" runat="server" />
                        <asp:Button ID="btnQuery" CssClass="hide" runat="server" Text="查询" OnClick="btnQuery_Click" />
                    </td>
                    <td valign="top">
                        <div style="width: 100%; float: left;">
                            <table border="0" cellpadding="0" cellspacing="0" class="table">
                                <tr>
                                    <td class="lefttd">所属公司：
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlCompany1" CssClass="INPUT" runat="server"
                                            AutoPostBack="True" OnSelectedIndexChanged="ddlCompany1_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td class="lefttd">项目编号：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="FORM_PRO_NUMBER" CssClass="INPUT" runat="server"></asp:TextBox>
                                        <font style="color: Red">*</font>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">项目名称：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtName" runat="server" CssClass="INPUT"></asp:TextBox>
                                        <font style="color: Red">*</font>
                                    </td>
                                    <td class="lefttd">父级项目：
                                    </td>
                                    <td class="righttd">
                                        <asp:DropDownList ID="ddlParentPro" CssClass="INPUT" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">顺序1：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="TextBox1" CssClass="INPUT" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="lefttd">状态：
                                    </td>
                                    <td class="righttd">
                                        <asp:DropDownList ID="ddlState" CssClass="INPUT" runat="server">
                                            <asp:ListItem Value="1" Selected="True">有效</asp:ListItem>
                                            <asp:ListItem Value="0">无效</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">顺序2：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="TextBox2" CssClass="INPUT" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="lefttd">节点类型：
                                    </td>
                                    <td class="righttd">
                                        <asp:DropDownList ID="DropDownList1" CssClass="INPUT" runat="server">
                                            <asp:ListItem Value="0" Selected="True">主节点</asp:ListItem>
                                            <asp:ListItem Value="1">支节点</asp:ListItem>
                                            <asp:ListItem Value="2">子节点</asp:ListItem>
                                            <asp:ListItem Value="3">子节点(不匹配)</asp:ListItem>
                                        </asp:DropDownList>
                                        <font style="color: Red">*子节点可录入</font>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">交易类型：
                                    </td>
                                    <td class="righttd">
                                        <asp:DropDownList ID="FORM_TYPE2" CssClass="INPUT" runat="server">
                                            <asp:ListItem Value="1" Selected="True">现金流入</asp:ListItem>
                                            <asp:ListItem Value="2">现金流出</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td class="lefttd">备 注：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtGLRY" CssClass="INPUT" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr style="display: none;">
                                    <td class="lefttd">关键字匹配1：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtGj1" Width="300px" CssClass="txt_input" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="lefttd">关键字匹配2：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtGj2" Width="300px" CssClass="txt_input" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr style="display: none;">
                                    <td class="lefttd">关键字匹配3：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtGj3" Width="300px" CssClass="txt_input" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="lefttd">关键字匹配4：
                                    </td>
                                    <td class="righttd">
                                        <asp:TextBox ID="txtGj4" Width="300px" CssClass="txt_input" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="lefttd">关键字匹配：
                                    </td>
                                    <td class="righttd" colspan="3">
                                        <asp:TextBox ID="FORM_CODE_STRING" CssClass="INPUT MAX" runat="server" OnClick="showmodal()" Text="请选择关键字"></asp:TextBox>
                                        <asp:HiddenField ID="FORM_CODE_IDS" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4" style="text-align: center;">
                                        <asp:Button ID="btnInsert" CssClass="bt_css_s" runat="server" Text="新增" OnClick="btnInsert_Click"
                                            OnClientClick="return confirm('确认添加?');" />
                                        &nbsp;
                                    <asp:Button ID="btnUpdate" CssClass="bt_css_s" runat="server" Text="修改" OnClick="btnUpdate_Click"
                                        OnClientClick="return confirm('确认修改?');" />
                                    </td>
                                </tr>
                                <tr>
                                    <%--       CssClass="cont_list" --%>
                                    <td colspan="4" style="text-align: center;">
                                        <asp:GridView ID="GvProject" Width="99%" AutoGenerateColumns="False" CssClass="cont_list zebra"
                                            AllowSorting="True" runat="server" EmptyDataText="没有查找到您要的数据"
                                            OnSorting="GvProject_Sorting" OnSelectedIndexChanging="GvProject_SelectedIndexChanging">
                                            <Columns>
                                                <asp:BoundField DataField="n_proid" HeaderText="ID" SortExpression="n_proid" />
                                                <asp:BoundField DataField="c_proname" HeaderText="名称" SortExpression="c_proname">
                                                    <%--    <ItemStyle HorizontalAlign="Left" />--%>
                                                    <ItemStyle CssClass="tdleft" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="state" HeaderText="状态" SortExpression="state" />
                                                <asp:BoundField DataField="n_num1" HeaderText="序号1" SortExpression="n_num1" />
                                                <asp:BoundField DataField="n_num2" HeaderText="序号2" SortExpression="n_num2" />
                                                <asp:BoundField DataField="c_pronum" HeaderText="项目编号" SortExpression="c_pronum" />
                                                <asp:BoundField DataField="c_remark" HeaderText="备注" SortExpression="c_remark" />
                                                <asp:BoundField DataField="n_type2" HeaderText="类型" SortExpression="n_type2" />
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <script type="text/javascript">
        var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
        var table = document.getElementById("tb_3");
        for (j = 0; j < table.rows[0].cells.length; j++) {
            table.rows[0].cells[j].onmousedown = function () {
                //记录单元格
                tTD = this;
                if (event.offsetX > tTD.offsetWidth - 10) {
                    tTD.mouseDown = true;
                    tTD.oldX = event.x;
                    tTD.oldWidth = tTD.offsetWidth;
                }
                //记录Table宽度
                //table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement;
                //tTD.tableWidth = table.offsetWidth;
            };
            table.rows[0].cells[j].onmouseup = function () {
                //结束宽度调整
                if (tTD == undefined) tTD = this;
                tTD.mouseDown = false;
                tTD.style.cursor = 'default';
            };
            table.rows[0].cells[j].onmousemove = function () {
                //更改鼠标样式
                if (event.offsetX > this.offsetWidth - 10)
                    this.style.cursor = 'col-resize';
                else
                    this.style.cursor = 'default';
                //取出暂存的Table Cell
                if (tTD == undefined) tTD = this;
                //调整宽度
                if (tTD.mouseDown != null && tTD.mouseDown == true) {
                    tTD.style.cursor = 'default';
                    if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
                        tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
                    //调整列宽
                    tTD.style.width = tTD.width;
                    tTD.style.cursor = 'col-resize';
                    //调整该列中的每个Cell
                    table = tTD;
                    while (table.tagName != 'TABLE') table = table.parentElement;
                    for (j = 0; j < table.rows.length; j++) {
                        table.rows[j].cells[tTD.cellIndex].width = tTD.width;
                    }
                    //调整整个表
                    //table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth);
                    //table.style.width = table.width;
                }
            };
        }
    </script>
</body>
</html>
